package com.example.mapper;

import com.example.entity.singerAndGame.Singer;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SingerMapper {
    @Select("select * from singers")
    List<Singer> getSingerList();

    @Select("select * from singers where sid = #{sid}")
    Singer getSingerBySid(int sid);

    @Insert("insert into singers (name, age, gender, motto, info, pic)" +
            " VALUES (#{name}, #{age}, #{gender}, #{motto}, #{info}, #{pic})")
    int addSinger(Singer singer);

    @Update("update singers set name = #{name}, age = #{age}, gender = #{gender}," +
            "motto = #{motto}, info = #{info}, pic = #{pic} where sid = #{sid}")
    int updateSingerBySid(Singer singer);

    @Delete("delete from singers where sid = #{sid}")
    int deleteSingerBySid(int sid);
}
